<div class="uk-container" ng-controller="add_apiCtrl" style="margin-left: 80px; margin-top: 20px">
    <div class="uk-grid">
        <div class="uk-width-10-10" style="margin-bottom: 10px">
            <div class="uk-grid uk-margin-top uk-margin-bottom">
                <div class="uk-width-6-10">
                    <ul class="uk-breadcrumb uk-vertical-align-middle uk-margin-left">
                        <li><span>我的项目</span></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="uk-width-10-10">
            <div class="uk-container">
                <div class="uk-grid">
                    <div class="uk-width-10-10" style="padding-left: 0px">
                        <div class="uk-panel uk-panel-box">
                            <form class="uk-form" name="addForm">
                                <div class="uk-grid">
                                    <div class="uk-width-5-10">
                                        <h3 class="uk-panel-title">
                                        <strong>URL：</strong>
                                        <input type="text" name="url" ng-model="url" style="width: 50%" required></input>
                                        </h3>
                                    </div>
                                    <div class="uk-width-5-10">
                                        <div class="uk-float-right">
                                            
                                            <label class="uk-margin-right uk-text-bold">修改分组</label>
                                            <select ng-model="groupSelected" ng-options="group.id as group.name for group in groups">
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="uk-grid">
                                    <div class="uk-width-10-10">
                                        <h3>
                                            <strong>访问方法：</strong>
                                            <label ng-repeat="method in methods">
                                                <input type="checkbox" ng-click="toggleSelection(method)">{{method.name}}</input>
                                            </label>
                                        </h3>
                                    </div>
                                </div>
                                <div class="uk-grid">
                                    <div class="uk-width-10-10">
                                        <h3><strong>API描述：</strong></h3>
                                        <textarea class="uk-width-1-1" rows="3" id="description" ng-model="desc"></textarea>
                                    </div>
                                </div>
                                <div class="uk-grid">
                                    <div class="uk-width-10-10">
                                        <h3><strong>请求参数：</strong></h3>
                                        <table class="uk-table uk-table-hover uk-table-striped">
                                            <thead>
                                                <tr>
                                                    <th class="uk-width-2-10 uk-text-center">参数名称</th>
                                                    <th class="uk-width-1-10 uk-text-center">类型</th>
                                                    <th class="uk-width-2-10 uk-text-center">取值限制</th>
                                                    <th class="uk-width-1-10 uk-text-center">必填</th>
                                                    <th class="uk-width-3-10 uk-text-center">备注</th>
                                                    <th class="uk-width-1-10 uk-text-center"></th>
                                                </tr>
                                            </thead>
                                            <tbody id="request">
                                                <tr ng-repeat="newParam in newParams">
                                                    <td class="uk-text-center">{{newParam.name}}</td>
                                                    <td class="uk-text-center">{{newParam.stype.name}}</td>
                                                    <td class="uk-text-center">{{newParam.restrict}}</td>
                                                    <td class="uk-text-center">{{newParam.required}}</td>
                                                    <td class="uk-text-center">{{newParam.remark}}</td>
                                                    <td class="uk-text-center">
                                                        <a class="uk-button uk-button-danger" ng-click="deleteParam(newParam.name)"><span class="uk-icon-close"></span></a>
                                                    </td>
                                                </tr>
                                                <tr id="newParamInput">
                                                    <td class="uk-text-center">
                                                        <input type="text" class="uk-width-1-1" name="addName" ng-model="add.name" required></input>
                                                    </td>
                                                    <td class="uk-text-center">
                                                        <select ng-model="add.type" ng-options="type as type.name for type in types">
                                                        </select>
                                                    </td>
                                                    <td class="uk-text-center">
                                                        <input type="text" class="uk-width-1-1" ng-model="add.restriction"></input>
                                                    </td>
                                                    <td class="uk-text-center">
                                                        <select ng-model="add.required">
                                                            <option value="true">是</option>
                                                            <option value="false">否</option>
                                                        </select>
                                                    </td>
                                                    <td class="uk-text-center">
                                                        <input type="text" class="uk-width-1-1" ng-model="add.remark"></input>
                                                    </td>
                                                    <td></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div class="uk-margin-right">
                                            <div class="uk-float-right">
                                                <a class="uk-button uk-button-success" id="add_request" ng-click="addParam()" ng-disabled="addForm.addName.$pristine"><span class="uk-icon-check"></span> Add</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="uk-grid">
                                    <div class="uk-width-10-10">
                                        <h3><strong>返回JSON样例：</strong></h3>
                                        <textarea class="uk-width-1-1" rows="5" id="json" ng-model="json"></textarea>
                                    </div>
                                </div>
                                <div class="uk-grid">
                                    <div class="uk-width-10-10">
                                        <h3><strong>返回数据说明：</strong></h3>
                                        <form class="uk-form" style="margin-bottom: 15px">
                                            <table class="uk-table uk-table-hover uk-table-striped">
                                                <thead>
                                                    <tr>
                                                        <th class="uk-width-2-10 uk-text-center">参数名称</th>
                                                        <th class="uk-width-1-10 uk-text-center">类型</th>
                                                        <th class="uk-width-6-10 uk-text-center">备注</th>
                                                        <th class="uk-width-1-10 uk-text-center"></th>
                                                    </tr>
                                                </thead>
                                                <tbody id="return">
                                                    <tr ng-repeat="newReturn in newReturns">
                                                        <td class="uk-text-center">{{newReturn.name}}</td>
                                                        <td class="uk-text-center">{{newReturn.stype.name}}</td>
                                                        <td class="uk-text-center">{{newReturn.remark}}</td>
                                                        <td class="uk-text-center">
                                                            <a class="uk-button uk-button-danger" ng-click="deleteReturn(newReturn.name)"><span class="uk-icon-close"></span></a>
                                                        </td>
                                                    </tr>
                                                    <tr id="return_input">
                                                        <td class="uk-text-center">
                                                            <input type="text" class="uk-width-1-1" id="returnName" ng-model="add.returnName"></input>
                                                        </td>
                                                        <td class="uk-text-center">
                                                            <select ng-model="add.returnType" ng-options="type as type.name for type in types">
                                                            </select>
                                                        </td>
                                                        <td class="uk-text-center">
                                                            <input type="text" class="uk-width-1-1" id="returnRemark" ng-model="add.returnRemark"></input>
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </form>
                                        <div class="uk-margin-right">
                                            <div class="uk-float-right">
                                                <a class="uk-button uk-button-success" id="add_return_desc" ng-click="addReturn()"><span class="uk-icon-check"></span> Add</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="uk-grid">
                                    <div class="uk-width-10-10">
                                        <h3><strong>状态码：</strong></h3>
                                        <form class="uk-form" style="margin-bottom: 15px">
                                            <table class="uk-table uk-table-hover uk-table-striped">
                                                <thead>
                                                    <tr>
                                                        <th class="uk-width-1-10 uk-text-center">状态码</th>
                                                        <th class="uk-width-8-10 uk-text-center">说明</th>
                                                        <th class="uk-width-1-10 uk-text-center"></th>
                                                    </tr>
                                                </thead>
                                                <tbody id="status">
                                                    <tr ng-repeat="status in newStatus">
                                                        <td class="uk-text-center">{{status.code}}</td>
                                                        <td class="uk-text-center">{{status.remark}}</td>
                                                        <td class="uk-text-center">
                                                            <a class="uk-button uk-button-danger" ng-click="deleteStatus(status.statusCode)"><span class="uk-icon-close"></span></a>
                                                        </td>
                                                    </tr>
                                                    <tr id="status_input">
                                                        <td class="uk-text-center">
                                                            <input type="text" class="uk-width-1-1" id="statusCode" ng-model="add.statusCode"></input>
                                                        </td>
                                                        <td class="uk-text-center">
                                                            <input type="text" class="uk-width-1-1" id="statusDesc" ng-model="add.desc"></input>
                                                        </td>
                                                        <td></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </form>
                                        <div class="uk-margin-right">
                                            <div class="uk-float-right">
                                                <a class="uk-button uk-button-success" ng-click="addStatus()"><span class="uk-icon-check"></span> Add</a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="uk-margin-bottom" style="overflow: hidden; margin-top: 30px; margin-right: 25px">
                    <a href="" class="uk-button uk-button-primary uk-button-large uk-float-right" ng-click="submit()">保存修改</a>
                </div>
            </div>
        </div>
    </div>
</div>
